/***************************************************************************
 *   Copyright (C) 2008 by Ryszard Król   *
 *   rysiek.krol@gmail.com   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef PICTURELISTWIDGETITEM_H
#define PICTURELISTWIDGETITEM_H

#include <QListWidgetItem>
#include <QIcon>
#include <QFileInfo>
#include <QDateTime>

/**
	@author Ryszard Król <rysiek.krol@gmail.com>
*/



class PictureListWidgetItem : public QListWidgetItem
{

private:
        QFileInfo file;
        QDateTime time;
        QString note;
        QString place;
        QString commentString;
	/**
 	* Odpakawuje plik .gz z komentarzem
 	* */
        int unGzip ( QFileInfo *fileInfo, QString *dest );
	/**
 	* Pobiera komentarz, miejsce i date z pliku xml
 	* */
        void getDescription (const  QFileInfo &fileInfo );
	/**
 	* Wczytuje obrazek z podanej Sciezki i zwraca przeskalowana ikone
 	*/
        QIcon generateIcon(const QFileInfo & filePatch );
        /**
         * Generuje Opis pod obrazkiem
         */
        void generateLabel();

        /**
         * Konwerter stringu na UTF-8
         */
	void textConverter(QString *text);
	
	QString cutString(QString string);

public:
        /**
         * Domyślny konstruktor
         */
        PictureListWidgetItem( QFileInfo & fileInfo, QListWidget * parent = 0);

        /**
         * Destruktor
         */
        ~PictureListWidgetItem();

        QDateTime getDateTime();
        bool isDate();
        void putIcon();
        void setNote ( const QString& theValue );
        QString getNote() const;
        void setPlace ( const QString& theValue );
        QString getPlace() const;
        void setFile ( const QFileInfo& theValue );
        QFileInfo getFile() ;
	QString getCommentString() const;
	





};

#endif
